#define _CRT_SECURE_NO_WARNINGS
#include<iostream>

using namespace std;

int main()
{
	char c[1000] = { 0 };
	char cp[1000] = { 0 };
	cin >> c;
	int fast = 0, slow = -1, n = 0, i = 0;
	while (c[fast] != '\0')
	{
		if(('a' <= c[fast] && c[fast]<='z')||('A'<= c[fast] && c[fast]<= 'Z'))
			cp[i++] = c[fast];
		else
		{
			for (int j = 0; j < c[fast]-'0'-1; j++)
			{
				cp[i++] = c[slow];
			}
		}
		++slow;
		++fast;
	}

	cout << cp;
	return 0;
}